SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwlConceptosDelAgentePorOrganizacion
AS
SELECT     CAO.IdConceptoDelAgentePorOrganizacion AS ID, A.Documento, A.ApellidosYNombres, O.CUISE, CL.Descripcion AS Concepto, CAO.ValidezHasta, 
                      CAO.NTUserAutor
FROM         dbo.tb_ConceptosDelAgentePorOrganizacion CAO INNER JOIN
                      dbo.vwrAgentes A ON CAO.Agente = A.ID INNER JOIN
                      dbo.vwrOrganizaciones O ON CAO.Organizacion = O.ID INNER JOIN
                      dbo.vwrConceptosDeLiquidacion CL ON CAO.Concepto = CL.ID

GO
GRANT SELECT ON  [dbo].[vwlConceptosDelAgentePorOrganizacion] TO [CentroDeDesignaciones]
GRANT SELECT ON  [dbo].[vwlConceptosDelAgentePorOrganizacion] TO [Informatica]
GRANT SELECT ON  [dbo].[vwlConceptosDelAgentePorOrganizacion] TO [PersonalDocente]
GRANT SELECT ON  [dbo].[vwlConceptosDelAgentePorOrganizacion] TO [SoloVer]
GRANT SELECT ON  [dbo].[vwlConceptosDelAgentePorOrganizacion] TO [Subsidios]
GRANT SELECT ON  [dbo].[vwlConceptosDelAgentePorOrganizacion] TO [SubsidiosConsulta]
GO
